<?php
  defined( '_JEXEC' ) or die( 'Restricted access' );
  
  // Require specific controller if requested
  if($controllerName = JRequest::getWord('c', 'season')) 
  {    
    $path = JPATH_COMPONENT.DS.'controllers'.DS.strtolower($controllerName).'.php';
    if (file_exists($path)) {
      require_once $path;
    } else {
      $controller = '';
    }
  }
  
  require_once JPATH_COMPONENT.DS.'pbnyhelper.php';
  
  JHTML::_('behavior.mootools');
  $document = &JFactory::getDocument();
  $document->addScript(JURI::root().'media/system/js/jquery-1.5.2.js');
  $document->addScript(JURI::root().'media/system/js/jquery.validate.js');
  if(is_a($document, 'JDocumentHTML'))
    $document->addCustomTag( '<script type="text/javascript">jQuery.noConflict();</script>' );
  $document->addScript('./components/com_pbny/pbny.js');
  $document->addStyleSheet('./components/com_pbny/pbny.css');

  $controllerName = $controllerName.'Controller';
  $controller = new $controllerName();
  $controller->execute( JRequest::getVar( 'task' ) );
  $controller->redirect();
?>